beg=int(input())
end=int(input())
i=0
a=0
for a in range(beg,end+1,1):
    a100=int(a//100)
    a10=int((a-a//100*100)//10)
    a1=int(a-a100*100-a10*10)
    if a ==a100**3+a10**3+a1**3:
        print(a)
        i+=1
        continue
while i==0:
    print('not found')
    break
